<!DOCTYPE html>
<html>

<head>
  <title>Coze API</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <style>
    body {
      font-family: Arial, sans-serif;
      max-width: 800px;
      margin: 0 auto;
      padding: 20px;
    }
    .env-status {
      margin: 20px 0;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 5px;
      background-color: #f5f5f5;
    }
    .success {
      color: green;
    }
    .error {
      color: red;
    }
    button {
      padding: 10px 15px;
      background-color: #4CAF50;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
    }
    button:hover {
      background-color: #45a049;
    }
    #reply {
      margin-top: 20px;
      padding: 15px;
      border: 1px solid #ddd;
      border-radius: 5px;
      min-height: 100px;
    }
  </style>
</head>

<body>
  <h1>Coze API 测试</h1>
  
  <div class="env-status">
    <h3>环境变量状态：</h3>
    <div id="env-bot-id">BOT_ID: 加载中...</div>
    <div id="env-api-key">API_KEY: 加载中...</div>
  </div>
  
  <button id="test-api">测试API调用</button>
  
  <h3>API 响应：</h3>
  <div id="reply">等待调用...</div>
  
  <script type="module" src="script.js"></script>
</body>

</html>